<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta http-equiv="Cache-Control" content="no-cache">
    <title>陕北矿业常态化运行评分管理系统</title>
    <!-- 依 赖 样 式 -->
    <link rel="stylesheet" href="component/pear/css/pear.css" />
    <!-- 加 载 样 式 -->
    <link rel="stylesheet" href="admin/css/loader.css" />
    <!-- 布 局 样 式 -->
    <link rel="stylesheet" href="admin/css/admin.css" />
    <link rel="icon" href="./favicon.ico">
    <style>
        /* 定义动画 */
        @keyframes warning-blink {
            0%, 100% { opacity: 1; }
            50% { opacity: 0; }
        }

        /* 应用动画到警告消息的类 */
        .warning-blink {
            animation: warning-blink 2s ease-in-out infinite; /* 应用动画，循环无限次 */
            font-size: 24px; /* 可根据需要调整图标大小 */
        }

        /* 可选：鼠标悬停时停止闪烁 */
        .warning-blink:hover {
            animation-play-state: paused;
        }
    </style>
</head>
<!-- 结 构 代 码 -->
<body class="layui-layout-body pear-admin">
<!-- 布 局 框 架 -->
<div class="layui-layout layui-layout-admin">
    <!-- 顶 部 样 式 -->
    <div class="layui-header">
        <!-- 菜 单 顶 部 -->
        <div class="layui-logo">
            <!-- 图 标 -->
            <img class="logo">
            <!-- 标 题 -->
            <span class="title" style="margin-left:0px;"></span>
        </div>
        <!-- 顶 部 左 侧 功 能 -->
        <ul class="layui-nav layui-layout-left">
            <li class="collapse layui-nav-item"><a href="#" class="layui-icon layui-icon-shrink-right"></a></li>
            <li class="refresh layui-nav-item"><a href="#" class="layui-icon layui-icon-refresh-1" loading = 600></a></li>
        </ul>
        <!-- 多 系 统 菜 单 -->
        <div id="control" class="layui-layout-control"></div>
        <!-- 顶 部 右 侧 菜 单 -->
        <ul class="layui-nav layui-layout-right">
<!--            <li class="layui-nav-item layui-hide-xs"><a href="#" class="menuSearch layui-icon layui-icon-search"></a></li>-->
            <li class="layui-nav-item layui-hide-xs"><a href="#" class="fullScreen layui-icon layui-icon-screen-full"></a></li>
            <li class="layui-nav-item layui-hide-xs message"><a id="notice" href="#" style="color: red;" class="notice layui-icon layui-icon-notice"></a></li>
            <li class="layui-nav-item user">
                <!-- 头 像 -->
                <a id="userName" class="layui-icon layui-icon-username" href="javascript:;"></a>
                <!-- 功 能 菜 单 -->
                <dl class="layui-nav-child">
                    <dd><a href="javascript:void(0);" user-menu-url="page/info.html" user-menu-id="50005" user-menu-title="密码修改">密码修改</a></dd>
                    <dd><a href="javascript:void(0);" class="logout">注销登录</a></dd>
                </dl>
            </li>
            <!-- 主 题 配 置 -->
            <li class="layui-nav-item setting"><a href="#" class="layui-icon layui-icon-more-vertical"></a></li>
        </ul>
    </div>
    <!-- 侧 边 区 域 -->
    <div class="layui-side layui-bg-black">
        <!-- 菜 单 顶 部 -->
        <div class="layui-logo">
            <!-- 图 标 -->
            <img class="logo">
            <!-- 标 题 -->
            <span class="title"></span>
        </div>
        <!-- 菜 单 内 容 -->
        <div class="layui-side-scroll">
            <div id="sideMenu"></div>
        </div>
    </div>
    <!-- 视 图 页 面 -->
    <div class="layui-body">
        <!-- 内 容 页 面 -->
        <div id="content"></div>
    </div>
    <!-- 页脚 -->
    <div class="layui-footer layui-text" style="background-color: whitesmoke;">
        <span class="left">
        </span>
        <span class="center jsFooter" style="cursor: pointer; color: #3963bc;">
            © 2024 陕北矿业信息技术运维分公司
        </span>
        <span class="right">
        </span>
    </div>
    <!-- 遮 盖 层 -->
    <div class="pear-cover"></div>
    <!-- 加 载 动 画 -->
    <div class="loader-main">
        <!-- 动 画 对 象 -->
        <div class="loader"></div>
    </div>
</div>
<!-- 移 动 端 便 捷 操 作 -->
<div class="pear-collapsed-pe collapse">
    <a href="#" class="layui-icon layui-icon-shrink-right"></a>
</div>
<!-- 依 赖 脚 本 -->
<script src="component/layui/layui.js"></script>
<script src="component/pear/pear.js"></script>
<script src="scripts/utils/request.js"></script>
<!-- 框 架 初 始 化 -->
<script>
    var $,admin,popup,layer
    layui.use(['admin','jquery','popup','drawer','layer'], function() {
        $ = layui.jquery;
        admin = layui.admin;
        popup = layui.popup;
        layer= layui.layer;

        let userName=localStorage.getItem("userName");
        let mineName=localStorage.getItem("mineName");

        admin.setConfigType("yml");
        let roleType=localStorage.getItem("roleType");
        let isManager=localStorage.getItem("isManager");
        if(roleType==3){
            if(isManager=='true'){
                admin.setConfigPath("config/pear-mine-area.config-manager.yml?v="+new Date().getTime());
            }else{
                admin.setConfigPath("config/pear-mine-area.config.yml?v="+new Date().getTime());
            }
        }else{
            if(isManager=='true'){
                admin.setConfigPath("config/pear-mine.config-manager.yml?v="+new Date().getTime());
            }else{
                admin.setConfigPath("config/pear-mine.config.yml?v="+new Date().getTime());
            }
        }
        admin.render();

        $("#userName").text(userName+'【'+mineName+'】')
        $("#userName").attr("class","");

        // 登出逻辑
        admin.logout(function(){
            popup.success("注销成功",function(){
                location.href = "index.html";
            })
            // 注销逻辑 返回 true / false
            return true;
        })

        let token = localStorage.getItem("token");
        if(token==null){
            popup.failure("登录失效，请重新登录", function() {
                parent.window.location.href = "/index.html"
            });
            return;
        }

        postAjaxNoSuccessTip('/api/message/getNotice',{},function (response){
            if(response.data>0){
                $('#notice').addClass('warning-blink').css('color','red');
            }else{
                $('#notice').removeClass('warning-blink').css('color','#fff');
            }
        });


        $('#notice').click(function () {
            if(localStorage.getItem("roleType")==3){
                layui.admin.addTab(30000,'矿井评分',"page/mineinfo.html");
            }else{
                layui.admin.addTab(40001,'评分管理',"page/pflistmine.html");
            }
        })
        
        $('.jsFooter').click(function(){
            layer.photos({
                title: "技术支持",
                toolbar:false,
                footer:false,
                closeBtn: 0,
                shade:0.3,
                shadeClose:true,
                photos: {
                  "title": "技术支持",
                  "start": 0,
                  "data": [{
                    alt: "技术支持",
                    pid: "技术支持",
                    src: "/admin/images/jszc.png"
                    }]
                }
            });
        })

    })
</script>
</body>
</html>
